package chapter4;

/**
 * 打印菱形
 */
public class Test4_6_2 {
    public static void main(String[] args) {
        for(int i =1 ;i<=3;i++) {
            for (int j = 1; j <= 3 - i; j++) {
                System.out.print(" ");//打印左边的空格
            }
            for (int j = 1; j <= 2 * i - 1; j++) {
                System.out.print("*"); //打印*号
            }
            for (int j = 1; j <= 3 - i; j++) {
                System.out.print(" ");//打印右边空格（也可以省略）
            }
            System.out.println();//这是每一行打印完就换
        }
        for (int i = 1; i <=2; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(" ");
            }
            for(int j=1;j<=5-2*i;j++){
                System.out.print("*");
            }
            for(int j=1;j<=i;j++){
                System.out.print(" ");
            }
            System.out.println();
        }

    }
}
